package com.qk.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.commen.PageResult;
import com.qk.dto.LogDto;
import com.qk.entity.OperateLog;
import com.qk.mapper.OperateLogMapper;
import com.qk.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {
    @Autowired
    private OperateLogMapper operateLogMapper;

    /**
     * 系统日志列表分页
     */
    @Override
    public PageResult<OperateLog> logList(LogDto logDto) {
        Page<OperateLog> page = operateLogMapper.logList(new Page<OperateLog>(logDto.getPage(), logDto.getPageSize() ), logDto);

        return new PageResult<>(page.getTotal(), page.getRecords());
    }
}
